<?php
include_once("init.php");  // Use session variable on this page. This function must put on the top of page.
if(!isset($_SESSION['username']) || $_SESSION['usertype'] !='admin'){ // if session variable "username" does not exist.
header("location:index.php?msg=Please%20login%20to%20access%20admin%20area%20!"); // Re-direct to index.php
}
else
{	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Sales Print</title>
<style type="text/css" media="print">
.hide{display:none}

</style>
<script type="text/javascript">
function printpage() {
document.getElementById('printButton').style.visibility="hidden";
window.print();
document.getElementById('printButton').style.visibility="visible";  
}
</script>

</head>

<body>

<table width="120" border="0" cellspacing="0" cellpadding="0">
 <?php 
 $test=$_POST['barcodeid'];
 for($ind=0; $ind<sizeof($_POST['barcodeid']); $ind++ )
 {
 	for($indRept=0;$indRept<$_POST['quantity'][$ind];$indRept++)
    {
  ?> <tr>
      <td>
          <strong><?php echo $_POST['stock_name'][$ind]; ?></strong><br/>
         <img src="barcodegen/test_1D.php?text=<?php echo $_POST['barcodeid'][$ind];?>" alt="barcode" />
         <div><span>Price:</span><span>&nbsp;&nbsp;&nbsp;</><span><?php echo $_POST['selling_price'][$ind];?></span></div>
      </td>
     </tr> 
     
     <tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr>
 <?php 
  }
 }?>
 
</table>


</body>
<script>
//window.print();	
</script>
</html>
<?php
}
?>